﻿function chontrinhdo(evt, trinhdo) {
    var i, x, tablinks;
    x = document.getElementsByClassName("cer-content");
    for (i = 0; i < x.length; i++) {
        x[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("cer-link");
    for (i = 0; i < x.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" w3-white w3-border-teal", " w3-grey w3-border-grey");
    }
    document.getElementById(trinhdo).style.display = "block";
    evt.currentTarget.className = evt.currentTarget.className.replace(" w3-grey w3-border-grey", " w3-white w3-border-teal");
}
function chonxephang(evt, xephang) {
    var i, x, tablinks;
    x = document.getElementsByClassName("top-content");
    for (i = 0; i < x.length; i++) {
        x[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("top-link");
    for (i = 0; i < x.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" w3-white w3-border-teal", " w3-grey w3-border-grey");
    }
    document.getElementById(xephang).style.display = "block";
    evt.currentTarget.className = evt.currentTarget.className.replace(" w3-grey w3-border-grey", " w3-white w3-border-teal");
}
$(document).ready(function () {
    $("#sl_cer_res").on("change", function () {
        chontrinhdo("event", "trinhdo" + this.value);
    });
});
(function ($) {
    $(function () {
        $("#nav_menu").headroom({
            // vertical offset in px before element is first unpinned
            offset: 100,
            // or you can specify tolerance individually for up/down scroll
            tolerance: {
                up: 20,
                down: 20
            }, classes: {               // when element is initialised
                initial: "headroom",
                // when scrolling up
                pinned: "headroom--pinned",
                // when scrolling down
                unpinned: "headroom--unpinned",
            }
        });
    }); // end of document ready
})(jQuery); // end of jQuery name space